ImageGear Professional v18 for Mac
Fit Mode

The sample contains a control for setting the Fit Mode. This method determines how the image is fitted in the window.

Initially the fit method is set to IG_DSPL_FIT_TO_DEVICE, which means that the entire image are displayed without scrolling in the window. If you do not change this setting and proceed to change an image, doing a rotate for example, the image still retains the fit to window setting; you will still be able to see the entire image.

The following code example sets the fit mode to the FIT_TO_WIDTH value:

 
Copy Code

- (IBAction)mnuDisplayLayoutFitTO_WIDTH:(id)sender {
    if(IG_image_is_valid(hIGear))
    {
        // Reset zoom
        IG_dspl_zoom_set( hIGear, 0, IG_DSPL_ZOOM_H_NOT_FIXED|IG_DSPL_ZOOM_V_NOT_FIXED, 1.0, 1.0 );
        // Set fit mode to IG_DSPL_FIT_TO_WIDTH
        IG_dspl_layout_set( hIGear, 0, IG_DSPL_FIT_MODE, NULL, NULL, NULL,
                           IG_DSPL_FIT_TO_WIDTH, 0, 0, 0.0 );
        // Update main view
        [mainScrollViewOutlet setNeedsDisplay:YES];
    }
}

In the sample below the image is fit to the width of the screen:

The scroll bar automatically appears on the right side of the image because the image is now as wide as the screen but is longer than the screen. 

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback